<style>
    .panel-post {
        position: relative;
    }

    .btn-post {
        position: absolute;
        right: 0;
        bottom: 10px;
    }
    #post-form .panel-default {
        padding:0;
    }
</style>

<link rel="stylesheet" href="__CDN__/assets/libs/bootstrap-select/dist/css/bootstrap-select.min.css">
<div class="container mt-20">
    <div id="content-container" class="container">
        <div class="row">
            <div class="col-md-3">
                {include file="common/sidenav" /}
            </div>
            <div class="col-md-9">
                <div class="panel panel-default panel-user">
                    <div class="panel-body">
                        {if $archives && $archives['status']=='normal'}
                        <div class="alert alert-danger">
                            <b>温馨提示：</b>当前{:$model?$model.name:'文章'}已经发布,如果修改将重新进入审核
                        </div>
                        {/if}
                        <div class="page-header panel-post">
                            <h2>{:$archives?'修改':'发布'}{:$model?$model.name:'文章'}</h2>
                        </div>
                        <div class="row">
                            <div class="col-xs-12">
                                <form id="post-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
                                    {:token()}
                                    <div class="form-group">
                                        <label for="c-channel_id" class="control-label col-xs-12 col-sm-2">{:__('Channel_id')}:</label>
                                        <div class="col-xs-12 col-sm-8">
                                            <select id="c-channel_id" data-rule="required" class="form-control" data-live-search="true" name="row[channel_id]">
                                                {$channelOptions}
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="c-title" class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
                                        <div class="col-xs-12 col-sm-8">
                                            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="{$archives.title|default=''}">
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label for="c-image" class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
                                        <div class="col-xs-12 col-sm-8">
                                            <div class="input-group">
                                                <input id="c-image" class="form-control" size="50" name="row[image]" type="text" value="{$archives.image|default=''}">
                                                <div class="input-group-addon no-border no-padding">
                                                    <span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                                                    <span class="msg-box n-right" for="c-image"></span>
                                                </div>
                                            </div>
                                            <ul class="row list-inline plupload-preview" id="p-image"></ul>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="c-tags" class="control-label col-xs-12 col-sm-2">{:__('Tags')}:</label>
                                        <div class="col-xs-12 col-sm-8">
                                            <input id="c-tags" data-rule="" class="form-control" placeholder="多个标签请使用半角逗号分隔" data-primary-key="name" data-multiple="true" name="row[tags]" type="text" value="{$archives.tags|default=''}">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="c-content" class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
                                        <div class="col-xs-12 col-sm-8">
                                            <textarea id="c-content" data-rule="required" class="form-control editor" name="row[content]" rows="15">{$archives.content|default=''}</textarea>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="c-keywords" class="control-label col-xs-12 col-sm-2">{:__('Keywords')}:</label>
                                        <div class="col-xs-12 col-sm-8">
                                            <input id="c-keywords" data-rule="" class="form-control" name="row[keywords]" type="text" value="{$archives.keywords|default=''}">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="c-description" class="control-label col-xs-12 col-sm-2">{:__('Description')}:</label>
                                        <div class="col-xs-12 col-sm-8">
                                            <textarea id="c-description" cols="60" rows="5" data-rule="" class="form-control" name="row[description]">{$archives.description|default=''}</textarea>
                                        </div>
                                    </div>
                                    <div id="extend"></div>

                                    <div class="form-group normal-footer">
                                        <label class="control-label col-xs-12 col-sm-2"></label>
                                        <div class="col-xs-12 col-sm-8">
                                            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
                                            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>